<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="xdz" uri="/xdztools" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>修改密码</title>
<link href="${xdz:domain() }/css/bootstrap.min.css" rel="stylesheet">
<link href="${xdz:domain() }/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="${xdz:domain() }/css/parsley.css" >
<script src="${xdz:domain() }/js/jquery.min.js"></script>
<script src="${xdz:domain() }/js/bootstrap.min.js"></script>
<script src="${xdz:domain() }/js/plugins/parsley/parsley.min.js"></script>
<script src="${xdz:domain() }/js/plugins/parsley/zh_cn.js"></script>
<script src="${xdz:domain() }/js/app.js"></script>
<script src="${xdz:domain() }/js/app.plugin.js"></script>
<script src="${xdz:domain() }/js/app.data.js"></script>
<script src="${xdz:domain() }/js/jquery.md5.js"></script>
<script type="text/javascript" src="${xdz:domain() }/js/plugins/layer/layer.min.js"></script>
</head>
<body>
    <form action="../systemUserBase/savePassword" class="form-horizontal" id="systemUserBaseForm" method="post" data-parsley-validate onsubmit="checkForm()">
        <div class="panel panel-default">
	        <div class="panel-heading">
	        	<div class="panel-title">修改密码</div>
	        </div>
	        <div class="panel-body">
                    <input type="hidden"  name="oldPasswordEncrypt" id="oldPasswordEncrypt">
                    <input type="hidden"  name="newPasswordEncrypt" id="newPasswordEncrypt">
                    <div class="form-group">
                        <label class="col-md-1 control-label">原密码</label>
                        <div class="col-md-2">
                            <input type="password" value="" placeholder="" id="oldPassword" class="bg-focus form-control" required="required" autocomplete="off">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-1 control-label">新密码</label>
                        <div class="col-md-2">
                            <input type="password" value="" placeholder="" id="newPassword" class="bg-focus form-control" required="required" autocomplete="off"
	                            data-parsley-required="true"
								data-parsley-trigger="focusout"
								data-parsley-required-message="密码不可为空"
								data-parsley-minlength="8"
								data-parsley-minlength-message="密码不可少于8位"
								data-parsley-maxlength="25"
								data-parsley-maxlength-message="密码不可多于25位"
								data-parsley-pattern="(?=(?:.*?\d){1})(?=.*[a-z])(?=(?:.*?[A-Z]){1})(?!.*\s)[0-9a-zA-Z!@#$%*()_+^&]*$"
								data-parsley-pattern-message="密码必须包含至少1个数字，1个大写字母和一些小写字母">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-1 control-label">确认密码</label>
                        <div class="col-md-2">
                            <input type="password" value="" placeholder="" id="confirmPassword" class="bg-focus form-control" required="required" autocomplete="off"
                            	data-parsley-required="true"
								data-parsley-trigger="focusout"
								data-parsley-required-message="确认密码不可为空"
								data-parsley-equalto="#newPassword"
								data-parsley-equalto-message="两次密码输入不一致">
                        </div>
                    </div>
                   <div class="form-group">
		                <div class="col-md-3">
<!-- 		                  <button type="button" class="btn btn-white pull-right" onclick="back()" style="margin-left:10px">取消</button> -->
		                  <button type="submit" class="btn btn-primary pull-right">保存</button>
		                </div>
		            </div>
            </div>
        </div>
    </form>
<script type="text/javascript">
	var message='${message}';
	if(message!=null&&message!=''){
		layer.alert(message);
	}

//     function back(){
//         history.go(-1);
//     }
    
     function checkForm(){
    	 $("#oldPasswordEncrypt").val(hex_md5($("#oldPassword").val()));
    	 $("#newPasswordEncrypt").val(hex_md5($("#newPassword").val()));
    }
    
    </script>
</body>
</html>
